<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="bootstrap.css"/>
    <link rel="stylesheet" href="bootstrap-theme.css"/>
    <script src="jquery-3.1.1.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $(document).bind("contextmenu",function(e){
                if($("#chkBlnRightKey").attr("checked")==true){
                   if($("#Radio1").attr("checked")==true)
                   return true
                    else{
                       if(!e.ctrlKey)
                       return false;
                       else
                       return true
                   }
                }
                else
                return false;
            });
            $("#chkBlnRightKey").bind("change",function(){
                if($(this).attr("checked")==true){
                    $("#Radio1,#Radio2").attr("disabled",false);
                    $("#Radio1").attr("checked",true);
                }
                else{
                    $("#Radio1,#Radio2").attr({"disabled":true,"checked":false});
                }
            });
        });
    </script>
    <title>contextmenu</title>
</head>
<body>
 <fieldset>
     <legend>设置</legend>
     <div class="div1">
         <input id="chkBlnRightKey" type="checkbox"/>是否开启网页右建菜单
         <div class="div2">
             <input id="Radio1" type="radio" name="rdoOpen" disabled="disabled"/>按鼠标右建开启<br/>
             <input id="Radio2" type="radio" name="rdoOpen" disabled="disabled"/>按鼠标左建开启
         </div>
     </div>
 </fieldset>
</body>
</html>